package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.CustomerCouponWalletSource;
import com.rockcent.mall.lib.domain.enumclass.CustomerCouponWalletStatus;
import com.rockcent.mall.lib.domain.enumclass.OrderVerificationWay;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by zhangjh on 2016/10/8.
 */
@Entity
@Table(name = "customer_coupon_wallet")
@DynamicInsert
@DynamicUpdate
public class CustomerCouponWallet extends IDEntityMall {

    @Column(columnDefinition = "bigint comment '卡券id'")
    private Long couponId;
    @Column(columnDefinition = "bigint comment '商家id'")
    private Long merchantId;
    @Column(columnDefinition = "bigint comment '平台id'")
    private Long mallId;
    @Column(columnDefinition = "bigint comment '客户id'")
    private Long customerId;
    @Column(columnDefinition = "varchar(50) comment '客户名称'")
    private String customerName;
    @Column(columnDefinition = "varchar(50) comment '使用门店'")
    private String merchantStoreName;
    @Column(columnDefinition = "bigint comment '使用数量'")
    private Long useNum;
    @Column(columnDefinition = "varchar(30) comment '核销类型'")
    @Enumerated(EnumType.STRING)
    private OrderVerificationWay verificationWay;

    @Column(columnDefinition = "varchar(30) comment '状态 TO_USE(\"待使用\"), USED(\"已使用\"), EXPIRED(\"已过期\")'")
    @Enumerated(EnumType.STRING)
    private CustomerCouponWalletStatus status;
    @Column(columnDefinition = "varchar(30) comment '领取来源 COUPON_CENTER(\"领券中心\"), GIFT_PACKET(\"礼包\"), MERCHANT(\"商家店铺\"),PROMOTE(\"二维码推广\"),RED_PACKET(\"红包\") '")
    @Enumerated(EnumType.STRING)
    private CustomerCouponWalletSource source;
    @Column(columnDefinition = "varchar(30) comment '兑换码'")
    private String verifyCode;
    @Column(columnDefinition = "text comment '二维码链接'")
    private String qrcCodeUrl;
    @Column(columnDefinition = "varchar(250) comment '核销唯一辨识码'")
    private String verifyKey;
    @Column(columnDefinition = "varchar(100) comment '礼包id'")
    private Long giftId;
    /**
     * 积分卡券id
     */
    @Column(columnDefinition = "bigint comment '积分卡券id'")
    private Long integrationCouponId;

    public static final String HAS_NOT_CAN_USE_COUPON = "没有可使用的卡卷";

    public Long getCouponId() {
        return couponId;
    }

    public void setCouponId(Long couponId) {
        this.couponId = couponId;
    }

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }


    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public CustomerCouponWalletStatus getStatus() {
        return status;
    }

    public void setStatus(CustomerCouponWalletStatus status) {
        this.status = status;
    }

    public CustomerCouponWalletSource getSource() {
        return source;
    }

    public void setSource(CustomerCouponWalletSource source) {
        this.source = source;
    }

    public String getQrcCodeUrl() {
        return qrcCodeUrl;
    }

    public void setQrcCodeUrl(String qrcCodeUrl) {
        this.qrcCodeUrl = qrcCodeUrl;
    }

    public String getVerifyCode() {
        return verifyCode;
    }

    public void setVerifyCode(String verifyCode) {
        this.verifyCode = verifyCode;
    }

    public String getVerifyKey() {
        return verifyKey;
    }

    public void setVerifyKey(String verifyKey) {
        this.verifyKey = verifyKey;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getMerchantStoreName() {
        return merchantStoreName;
    }

    public void setMerchantStoreName(String merchantStoreName) {
        this.merchantStoreName = merchantStoreName;
    }

    public Long getUseNum() {
        return useNum;
    }

    public void setUseNum(Long useNum) {
        this.useNum = useNum;
    }

    public OrderVerificationWay getVerificationWay() {
        return verificationWay;
    }

    public void setVerificationWay(OrderVerificationWay verificationWay) {
        this.verificationWay = verificationWay;
    }

    public Long getIntegrationCouponId() {
        return integrationCouponId;
    }

    public void setIntegrationCouponId(Long integrationCouponId) {
        this.integrationCouponId = integrationCouponId;
    }

    public Long getGiftId() {
        return giftId;
    }

    public void setGiftId(Long giftId) {
        this.giftId = giftId;
    }

    @Override
    public String toString() {
        return "CustomerCouponWallet{" +
                "couponId=" + couponId +
                ", merchantId=" + merchantId +
                ", mallId=" + mallId +
                ", customerId=" + customerId +
                ", customerName='" + customerName + '\'' +
                ", merchantStoreName='" + merchantStoreName + '\'' +
                ", useNum=" + useNum +
                ", verificationWay=" + verificationWay +
                ", status=" + status +
                ", source=" + source +
                ", verifyCode='" + verifyCode + '\'' +
                ", qrcCodeUrl='" + qrcCodeUrl + '\'' +
                ", verifyKey='" + verifyKey + '\'' +
                ", giftId=" + giftId +
                ", integrationCouponId=" + integrationCouponId +
                '}';
    }
}
